package com.valuegroup.smarttodo.plugins.calendarview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import com.haibin.calendarview.CalendarLayout;

/**
 * 如果嵌套各种View出现事件冲突，可以实现这个方法即可
 */
public class CalendarLinearLayout extends LinearLayout implements CalendarLayout.CalendarScrollView {

    public CalendarLinearLayout(Context context) {
        super(context);
        //initView(context);
    }

    public CalendarLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        //initView(context);
    }

    /*RecyclerView recyclerView;

    private void initView(Context context) {
        recyclerView = findViewById(R.id.recyclerView);
    }*/

    /**
     * 如果你想让下拉无效，return false
     *
     * @return isScrollToTop
     */
    @Override
    public boolean isScrollToTop() {
        System.out.println("自定义：非日历控件滑动时，日历不展开");
        //return recyclerView != null && recyclerView.computeVerticalScrollOffset() == 0;
        return false;
    }

}
